<template>
	<view class="my_code">
		<image class="code_img" src="@/static/images/code_background.png" mode="widthFix"></image>
		<view class="main">
			<view class="header">
				<image :src="userinfo.avatar || avtar" mode="aspectFill"></image>
			</view>
			<view class="name">{{userinfo.username}}的店</view>
			<view class="code">
				<image :src="image" mode=""></image>
			</view>
			<view class="text">
				<text>轻延精选 | 商城</text>
				<text>欢迎您的到来</text>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState } from 'vuex';
	export default {
		data() {
			return {
				avtar:require('@/static/images/headerImage.png'),
				image:'',
			};
		},
		computed:{
			...mapState({
				userinfo: state => state.userinfo
			})
		},
		onLoad() {
			var that = this
			that.$tips.showLoading('加载中')
			that.$httpApi.userPosters().then((res)=>{
				that.$tips.hideLoading()
				if(res.code==1){
					that.image=res.data
				}
			})
		},
	}
</script>

<style lang="less">
	.my_code{
		width: 100%;
		height: 100vh;
		.code_img{
			display: block;
			width: 100%;
			height: 100%;
		}
		.main{
			position: absolute;
			top: 50%;
			left: 50%;
			z-index: 1;
			width: 600rpx;
			height: 880rpx;
			margin-left: -300rpx;
			margin-top: -440rpx;
			background: #E6F5F3;
			border-radius: 20rpx;
			.header{
				width: 160rpx;
				height: 160rpx;
				margin: -80rpx auto 0;
				border: 4rpx solid #fff;
				border-radius: 50%;
				image{
					display: block;
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}
			.name{
				padding: 32rpx 0 40rpx;
				width: 100%;
				font-size: 44rpx;
				text-align: center;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #222222;
			}
			.code{
				width: 490rpx;
				height: 490rpx;
				padding: 30rpx;
				margin: auto;
				background: #FFFFFF;
				border-radius: 20rpx;
				image{
					display: block;
					width: 100%;
					height: 100%;
				}
			}
			.text{
				width: 100%;
				padding-top: 40rpx;
				text-align: center;
				font-size: 30rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #666666;
				line-height: 48rpx;
				text{
					display: block;
				}
			}
		}
	}
</style>
